import Vue from 'vue'
import VueRouter from 'vue-router'

const home = () => import('../views/home/home')

const news = () => import('../views/new/news')
const education = () => import('../views/education/education')
const about = () => import('../views/about/about')
const security = () => import('../views/security/security')

const All = () => import('views/new/newViews/All/All')
const PolicyDynamic = () => import('views/new/newViews/PolicyDynamic/PolicyDynamic')
const PolicyNews = () => import('views/new/newViews/PolicyNews/PolicyNews')
const LatestPolicy = () => import('views/new/newViews/LatestPolicy/LatestPolicy')

Vue.use(VueRouter)

const routes = [
  {
    path: '',
    redirect: '/home'
  },
  // 首页
  {
    path: '/home',
    component: home
  },
  // 新闻
  {
    path: '/news',
    component: news,
    children: [
      {
        path: '',
        redirect: 'All'
      },
      {
        //全部
        path: 'All',
        component: All
      },
      {
        //政策动态
        path: 'PolicyDynamic',
        component: PolicyDynamic
      },
      {
        //政策新文
        path: 'PolicyNews',
        component: PolicyNews
      },
      {
        //最新政策
        path: 'LatestPolicy',
        component: LatestPolicy
      }
    ]
  },
  // 残保金
  {
    path: '/security',
    component: security
  },
  // 职业教育
  {
    path: '/education',
    component: education
  },
  // 关于
  {
    path: '/about',
    component: about
  }
  
]

const router = new VueRouter({
  routes
})

export default router
